#!/usr/bin/env python
# -*- coding: ISO-8859-1 -*-

__author__  = 'bryan conrad'
__license__ = 'GPL'
__doc__ = """
This program is GUI view for the Python version of the JointTrack renderer    
"""
import vtk
import wx
import os
import sys
from enthought.pyface.api import GUI
from enthought.traits.api import Delegate, Enum, Float, HasTraits, Instance, Str
from enthought.tvtk.tools import ivtk
from time import sleep
import pyJT

class GUIWin(HasTraits):
    """This is the main window application"""
    def __init__(self):
        print 'Starting JointTrack model'
        model = pyJT.pyJTRederer()
        model.UseCone()
        model.UseImage()

        self.viewer = ivtk.IVTKWithCrustAndBrowser(size=(512,512))
        self.viewer.open()
        self.viewer.scene.add_actors(model.coneActor)
        self.viewer.scene.add_actors(model.imageActor)
        #self.viewer.configure_traits()
        while self.viewer.control != None:
            pass
        print 'Done with IVTK?'

if __name__ == "__main__":
    gui = GUIWin()
    print 'Done'
    